home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 24
/
Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso
/
Aminet
/
util
/
dir
/
simplefind.lha
/
SimpleFind
/
ARexx
/
simplefind_dopus.rexx
Wrap
OS/2 REXX Batch file
|
1998-01-25
|
3KB
|
101 lines
/* $VER: simplefind_dopus.rexx 1.0 (25.01.98)
* Allows SimpleFind to show its results in a DOpus lister
*/
options results
sfportname = 'SIMPLEFIND.1'
scriptportname = 'SIMPLEFIND_DOPUS'
dopusportname = 'DOPUS.1'
/* chek for Dopus */
if ~show('p',dopusportname) then do
say 'Directory Opus doesn''t run'
exit
end
/* open rexxsupport.library which gives us some functions to
handle messages */
if ~show('l','rexxsupport.library') then
call addlib('rexxsupport.library',0,-30)
/* load SimpleFind if not already done */
if ~show('p',sfportname) then do
address command 'run >NIL: <NIL: /SimpleFind guimode=showgui'
loaded=0
do for 25 while loaded=0
delay(15)
if show('p',sfportname) then loaded=1
end
if loaded=0 then exit
drop loaded
end
/* create own messageport, which SimpleFind uses to send a message
to the Script */
if ~openport( scriptportname ) then exit
address value sfportname
addnotifyport scriptportname /* tell SimpleFind where to send the messages */
dontshowresults /* no ResultWindow Needed */
cl = 0; /* no currentlister yet */
do until event='quit'
waitpkt(scriptportname) /* Wait for a message, sent by SimpleFind */
packet = getpkt(scriptportname) /* Get the message */
if packet ~= '00000000'x then do
event = getarg(packet,0) /* Get the message command */
reply(packet) /* Reply the Message */
if event = 'start searching' then do
/* prepare the lister */
address value dopusportname
lister new
cl = result
lister SET cl BUSY 1
lister EMPTY cl
lister SET cl TITLE "SimpleFind"
lister REFRESH cl FULL
end
if event = 'ready' then do
/* fill in the lister */
address value sfportname
getmaxentries
entries = result
getmaxfullpathlen
mfpl = result
setentrypos 0
address value dopusportname
lister SET cl NAMELENGTH mfpl
do for entries
/* get current entry and move cursor to the next entry */
address
getentrynext
/* add the entry to the list */
address
lister ADD cl '"'entry.name'"' entry.size "-1" entry.seconds "rwed" entry.comment
end
lister REFRESH cl
lister SET cl BUSY 0
cl = 0
end
end
end
if show('p',sfportname) then do
address value sfportname
removenotifyport scriptportname
end